package arithmetic;


public class DirectInsertSort {
    public static void main(String[] args) {
        int[] a = {2,1,2,5,4,3,6,8,9,8,8,7,6};
        int size = a.length;
        for (int i = 1; i < size; i++) {
            int temp = a[i];
            int j = i - 1;
            for (; j >= 0; j--) {
                if (a[j] > temp) {
                    a[j + 1] = a[j];
                } else {
                    break;
                }
            }
            a[j + 1] = temp;
            System.out.println();
        }
    }
}
